import { defineConfig } from 'vite';
import viteBaseConfig from './vite.base.config.ts';
import viteBuildConfig from './vite.build.config.ts';

const envResolver = {
  build: () => Object.assign({}, viteBaseConfig, viteBuildConfig), // build命令启动
  serve: () => Object.assign({}, viteBaseConfig), // serve命令启动(npm run dev)
};

export default defineConfig(({ command }) => {
  return envResolver[command]();
});
